# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=stacoan
pkgver=0.90
pkgrel=1
pkgdesc='Crossplatform tool which aids developers, bugbounty hunters and ethical hackers performing static code analysis on mobile applications.'
arch=('x86_64' 'aarch64')
groups=('blackarch' 'blackarch-mobile' 'blackarch-code-audit')
url='https://github.com/vincentcox/StaCoAn'
license=('MIT')
makedepends=('unzip')
source=("https://github.com/vincentcox/$pkgname/releases/download/v$pkgver/linux.zip")
sha512sums=('966aeb34d692abe28e69a226286af39c27d36cee490f185d9a816ae477ba62bb90788ae541bf4d402a298a8d64a76f3717e7d9f94ee1abc510e6d981c3faf2b3')

package() {
  cd deploy

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md

  rm README.md

  cp -a --no-preserve=ownership * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec ./$pkgname "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

